<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单支付 - Surreal Gallery 超现实主义数字藏品平台</title>
    <!-- 引入Font Awesome 6.4.0图标库 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 继承首页样式变量 */
        :root {
            --primary: #6a11cb;
            --secondary: #2575fc;
            --accent: #ff2e63;
            --dark: #1a1a2e;
            --light: #f0f0f0;
            --surreal-purple: #8a2be2;
            --surreal-blue: #00b4d8;
            --surreal-pink: #ff6b6b;
            --surreal-yellow: #f9d423;
            --surreal-green: #2ecc71;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
            color: var(--light);
            overflow-x: hidden;
            min-height: 100vh;
        }

        /* 超现实主义背景元素 */
        .floating-elements {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
        }

        .floating-element {
            position: absolute;
            border-radius: 50%;
            opacity: 0.1;
            filter: blur(40px);
            animation: float 15s infinite ease-in-out;
        }

        .floating-element:nth-child(1) {
            width: 300px;
            height: 300px;
            background: var(--surreal-purple);
            top: 10%;
            left: 5%;
            animation-delay: 0s;
        }

        .floating-element:nth-child(2) {
            width: 200px;
            height: 200px;
            background: var(--surreal-blue);
            top: 60%;
            right: 10%;
            animation-delay: 3s;
        }

        .floating-element:nth-child(3) {
            width: 250px;
            height: 250px;
            background: var(--surreal-pink);
            bottom: 10%;
            left: 20%;
            animation-delay: 6s;
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0) rotate(0deg);
            }

            50% {
                transform: translateY(-20px) rotate(180deg);
            }
        }

        /* 导航栏 */
        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 5%;
            position: fixed;
            width: 100%;
            z-index: 1000;
            background: rgba(26, 26, 46, 0.8);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .logo {
            font-size: 28px;
            font-weight: 700;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
        }

        nav ul {
            display: flex;
            list-style: none;
        }

        nav ul li {
            margin-left: 30px;
        }

        nav ul li a {
            color: var(--light);
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
        }

        nav ul li a:hover {
            color: var(--surreal-pink);
        }

        nav ul li a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -5px;
            left: 0;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            transition: width 0.3s ease;
        }

        nav ul li a:hover::after {
            width: 100%;
        }

        .cta-button {
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 30px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
        }

        .cta-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(106, 17, 203, 0.6);
        }

        /* 页面标题区域 */
        .page-header {
            padding: 150px 5% 80px;
            text-align: center;
            position: relative;
        }

        .page-title {
            font-size: 3.5rem;
            margin-bottom: 20px;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue), var(--surreal-pink));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            line-height: 1.2;
        }

        .page-subtitle {
            font-size: 1.2rem;
            max-width: 600px;
            margin: 0 auto;
            opacity: 0.8;
            line-height: 1.6;
        }

        /* 支付容器 */
        .checkout-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 5% 100px;
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 40px;
        }

        /* 支付内容 */
        .checkout-content {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 30px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .section-title {
            font-size: 1.8rem;
            margin-bottom: 25px;
            color: var(--surreal-blue);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .section-title i {
            font-size: 1.5rem;
        }

        /* 支付步骤指示器 */
        .checkout-steps {
            display: flex;
            justify-content: space-between;
            margin-bottom: 40px;
            position: relative;
        }

        .checkout-steps::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 0;
            right: 0;
            height: 2px;
            background: rgba(255, 255, 255, 0.1);
            z-index: 1;
        }

        .step {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 2;
        }

        .step-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
            transition: all 0.3s ease;
        }

        .step.active .step-icon {
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            transform: scale(1.1);
        }

        .step.completed .step-icon {
            background: var(--surreal-green);
        }

        .step-label {
            font-size: 0.9rem;
            opacity: 0.7;
        }

        .step.active .step-label {
            opacity: 1;
            font-weight: 600;
            color: var(--surreal-blue);
        }

        /* 支付方式选择 */
        .payment-methods {
            margin-bottom: 40px;
        }

        .payment-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .payment-option {
            background: rgba(255, 255, 255, 0.03);
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .payment-option:hover {
            background: rgba(255, 255, 255, 0.07);
            transform: translateY(-3px);
        }

        .payment-option.selected {
            border-color: var(--surreal-purple);
            background: rgba(138, 43, 226, 0.1);
        }

        .payment-icon {
            font-size: 2.5rem;
            margin-bottom: 10px;
            color: var(--surreal-blue);
        }

        .payment-option.selected .payment-icon {
            color: var(--surreal-purple);
        }

        .payment-name {
            font-weight: 600;
            margin-bottom: 5px;
        }

        .payment-desc {
            font-size: 0.9rem;
            opacity: 0.7;
        }

        /* 钱包连接区域 */
        .wallet-connection {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 30px;
        }

        .wallet-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .wallet-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .wallet-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
        }

        .wallet-details h3 {
            font-size: 1.2rem;
            margin-bottom: 5px;
        }

        .wallet-details p {
            font-size: 0.9rem;
            opacity: 0.7;
        }

        .wallet-balance {
            text-align: right;
        }

        .balance-label {
            font-size: 0.9rem;
            opacity: 0.7;
            margin-bottom: 5px;
        }

        .balance-amount {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--surreal-green);
        }

        .connect-wallet-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            color: white;
            border: none;
            border-radius: 15px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .connect-wallet-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(106, 17, 203, 0.6);
        }

        .connect-wallet-btn:disabled {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.5);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* 支付确认区域 */
        .payment-confirmation {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 30px;
        }

        .confirmation-title {
            font-size: 1.3rem;
            margin-bottom: 20px;
            color: var(--surreal-blue);
        }

        .confirmation-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .detail-item {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .detail-label {
            opacity: 0.7;
        }

        .detail-value {
            font-weight: 600;
        }

        .total-amount {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--surreal-pink);
            text-align: right;
            margin-top: 10px;
        }

        .terms-agreement {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            font-size: 0.9rem;
        }

        .terms-agreement input {
            width: 18px;
            height: 18px;
        }

        .terms-agreement a {
            color: var(--surreal-blue);
            text-decoration: none;
        }

        .terms-agreement a:hover {
            text-decoration: underline;
        }

        .confirm-payment-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(45deg, var(--surreal-green), var(--surreal-blue));
            color: white;
            border: none;
            border-radius: 15px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .confirm-payment-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(46, 204, 113, 0.6);
        }

        .confirm-payment-btn:disabled {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.5);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* 支付侧边栏 */
        .checkout-sidebar {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        .order-summary {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 25px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .order-items {
            margin-bottom: 20px;
        }

        .order-item {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .order-item:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
        }

        .item-image {
            width: 60px;
            height: 60px;
            border-radius: 10px;
            background: linear-gradient(45deg, var(--surreal-purple), var(--surreal-blue));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
            flex-shrink: 0;
        }

        .item-details {
            flex-grow: 1;
        }

        .item-title {
            font-size: 1rem;
            margin-bottom: 5px;
        }

        .item-price {
            font-weight: 600;
            color: var(--surreal-pink);
        }

        .summary-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .summary-row:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
            font-weight: 700;
            font-size: 1.2rem;
        }

        .total-price {
            color: var(--surreal-pink);
            font-size: 1.4rem;
        }

        /* 安全保障 */
        .security-card {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 25px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .security-features {
            list-style: none;
            line-height: 1.8;
        }

        .security-features li {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .security-features li:last-child {
            margin-bottom: 0;
        }

        .security-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(46, 204, 113, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--surreal-green);
            flex-shrink: 0;
        }

        /* 支付成功模态框 */
        .payment-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
            border-radius: 20px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            text-align: center;
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .modal-close {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            color: var(--light);
            font-size: 1.5rem;
            cursor: pointer;
        }

        .modal-icon {
            font-size: 4rem;
            color: var(--surreal-green);
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 2rem;
            margin-bottom: 15px;
            background: linear-gradient(45deg, var(--surreal-green), var(--surreal-blue));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .modal-message {
            margin-bottom: 30px;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 15px;
            justify-content: center;
        }

        /* 页脚 */
        footer {
            background: rgba(0, 0, 0, 0.5);
            padding: 50px 5% 20px;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 40px;
            margin-bottom: 40px;
        }

        .footer-column h3 {
            font-size: 1.2rem;
            margin-bottom: 20px;
            color: var(--surreal-blue);
        }

        .footer-column ul {
            list-style: none;
        }

        .footer-column ul li {
            margin-bottom: 10px;
        }

        .footer-column ul li a {
            color: var(--light);
            text-decoration: none;
            opacity: 0.7;
            transition: all 0.3s ease;
        }

        .footer-column ul li a:hover {
            opacity: 1;
            color: var(--surreal-pink);
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }

        .social-link {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .social-link:hover {
            background: var(--surreal-purple);
            transform: translateY(-3px);
        }

        .social-links a {
            text-decoration: none;
            color: #fff;
        }

        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            opacity: 0.7;
        }

        /* 响应式设计 */
        @media (max-width: 968px) {
            .page-title {
                font-size: 2.8rem;
            }

            .checkout-container {
                grid-template-columns: 1fr;
            }

            .payment-options {
                grid-template-columns: 1fr;
            }

            .confirmation-details {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            nav ul {
                display: none;
            }

            .page-header {
                padding: 130px 5% 60px;
            }

            .page-title {
                font-size: 2.2rem;
            }

            .checkout-steps {
                flex-direction: column;
                gap: 20px;
            }

            .checkout-steps::before {
                display: none;
            }

            .step {
                flex-direction: row;
                gap: 15px;
            }

            .wallet-status {
                flex-direction: column;
                gap: 15px;
                text-align: center;
            }

            .modal-actions {
                flex-direction: column;
            }
        }
    </style>
</head>

<body>
    <!-- 超现实主义背景元素 -->
    <div class="floating-elements">
        <div class="floating-element"></div>
        <div class="floating-element"></div>
        <div class="floating-element"></div>
    </div>

    <!-- 导航栏 -->
    <header>
        <div class="logo">Surreal Gallery</div>
        <nav>
            <ul>
                <li><a href="index.html">首页</a></li>
                <li><a href="collections.html">数字藏品</a></li>
                <li><a href="artists.html">艺术家</a></li>
                <li><a href="news.html">新闻动态</a></li>
                <li><a href="#faq">常见问题</a></li>
            </ul>
        </nav>
        <button class="cta-button">连接钱包</button>
    </header>

    <!-- 页面标题区域 -->
    <section class="page-header">
        <h1 class="page-title">订单支付</h1>
        <p class="page-subtitle">确认您的订单信息并完成支付，即将拥有独特的超现实主义数字藏品</p>
    </section>

    <!-- 支付容器 -->
    <section class="checkout-container">
        <!-- 支付内容 -->
        <div class="checkout-content">
            <!-- 支付步骤指示器 -->
            <div class="checkout-steps">
                <div class="step completed">
                    <div class="step-icon"><i class="fas fa-shopping-cart"></i></div>
                    <span class="step-label">购物车</span>
                </div>
                <div class="step active">
                    <div class="step-icon"><i class="fas fa-credit-card"></i></div>
                    <span class="step-label">支付信息</span>
                </div>
                <div class="step">
                    <div class="step-icon"><i class="fas fa-check-circle"></i></div>
                    <span class="step-label">完成</span>
                </div>
            </div>

            <!-- 支付方式选择 -->
            <div class="payment-methods">
                <h2 class="section-title"><i class="fas fa-wallet"></i> 选择支付方式</h2>
                <div class="payment-options">
                    <div class="payment-option selected" data-method="crypto">
                        <div class="payment-icon"><i class="fab fa-ethereum"></i></div>
                        <div class="payment-name">加密货币</div>
                        <div class="payment-desc">使用ETH或其他加密货币支付</div>
                    </div>
                    <div class="payment-option" data-method="card">
                        <div class="payment-icon"><i class="fas fa-credit-card"></i></div>
                        <div class="payment-name">信用卡/借记卡</div>
                        <div class="payment-desc">Visa, MasterCard, American Express</div>
                    </div>
                    <div class="payment-option" data-method="wallet">
                        <div class="payment-icon"><i class="fas fa-mobile-alt"></i></div>
                        <div class="payment-name">数字钱包</div>
                        <div class="payment-desc">Apple Pay, Google Pay, 支付宝</div>
                    </div>
                </div>
            </div>

            <!-- 钱包连接区域 -->
            <div class="wallet-connection">
                <div class="wallet-status">
                    <div class="wallet-info">
                        <div class="wallet-avatar"><i class="fas fa-wallet"></i></div>
                        <div class="wallet-details">
                            <h3>MetaMask 钱包</h3>
                            <p>未连接</p>
                        </div>
                    </div>
                    <div class="wallet-balance">
                        <div class="balance-label">余额</div>
                        <div class="balance-amount">0.00 ETH</div>
                    </div>
                </div>
                <button class="connect-wallet-btn" id="connectWalletBtn">
                    <i class="fas fa-plug"></i> 连接钱包
                </button>
            </div>

            <!-- 支付确认区域 -->
            <div class="payment-confirmation">
                <h3 class="confirmation-title">支付确认</h3>
                <div class="confirmation-details">
                    <div class="detail-item">
                        <span class="detail-label">支付方式</span>
                        <span class="detail-value" id="paymentMethodValue">加密货币 (ETH)</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">网络费用</span>
                        <span class="detail-value" id="networkFeeValue">0.0025 ETH</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">预计到账时间</span>
                        <span class="detail-value" id="deliveryTimeValue">即时</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">订单编号</span>
                        <span class="detail-value" id="orderIdValue">SG20230527001</span>
                    </div>
                </div>
                <div class="detail-item">
                    <span class="detail-label">订单总额</span>
                    <span class="total-amount" id="orderTotalValue">2.75 ETH</span>
                </div>

                <div class="terms-agreement">
                    <input type="checkbox" id="termsAgreement">
                    <label for="termsAgreement">我同意 <a href="#">服务条款</a> 和 <a href="#">隐私政策</a></label>
                </div>

                <button class="confirm-payment-btn" id="confirmPaymentBtn" disabled>
                    <i class="fas fa-lock"></i> 确认支付
                </button>
            </div>
        </div>

        <!-- 支付侧边栏 -->
        <div class="checkout-sidebar">
            <div class="order-summary">
                <h2 class="section-title"><i class="fas fa-receipt"></i> 订单摘要</h2>
                <div class="order-items">
                    <!-- 订单项目将通过JavaScript动态生成 -->
                </div>
                <div class="summary-row">
                    <span>小计</span>
                    <span id="sidebarSubtotal">2.50 ETH</span>
                </div>
                <div class="summary-row">
                    <span>服务费</span>
                    <span id="sidebarServiceFee">0.25 ETH</span>
                </div>
                <div class="summary-row">
                    <span>网络费用</span>
                    <span id="sidebarNetworkFee">0.0025 ETH</span>
                </div>
                <div class="summary-row">
                    <span>总计</span>
                    <span class="total-price" id="sidebarTotal">2.7525 ETH</span>
                </div>
            </div>

            <div class="security-card">
                <h2 class="section-title"><i class="fas fa-shield-alt"></i> 安全保障</h2>
                <ul class="security-features">
                    <li>
                        <div class="security-icon"><i class="fas fa-lock"></i></div>
                        <span>端到端加密交易</span>
                    </li>
                    <li>
                        <div class="security-icon"><i class="fas fa-certificate"></i></div>
                        <span>区块链技术保障</span>
                    </li>
                    <li>
                        <div class="security-icon"><i class="fas fa-check-double"></i></div>
                        <span>智能合约验证</span>
                    </li>
                    <li>
                        <div class="security-icon"><i class="fas fa-user-shield"></i></div>
                        <span>买家保护政策</span>
                    </li>
                </ul>
            </div>
        </div>
    </section>

    <!-- 支付成功模态框 -->
    <div class="payment-modal" id="paymentModal">
        <div class="modal-content">
            <button class="modal-close" id="modalClose">&times;</button>
            <div class="modal-icon"><i class="fas fa-check-circle"></i></div>
            <h2 class="modal-title">支付成功！</h2>
            <p class="modal-message">您的订单已成功支付，数字藏品正在转移到您的钱包中。您可以在"我的藏品"中查看和管理您的收藏。</p>
            <div class="modal-actions">
                <button class="cta-button" id="viewCollectionBtn">查看我的藏品</button>
                <button class="secondary-button" id="continueShoppingBtn">继续购物</button>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer>
        <div class="footer-content">
            <div class="footer-column">
                <h3>Surreal Gallery</h3>
                <p>探索超现实数字艺术的新维度，发现独一无二的数字藏品。</p>
                <div class="social-links">
                    <a href="#" class="social-link"><i class="fab fa-facebook-f"></i></a>
                    <a href="#" class="social-link"><i class="fab fa-twitter"></i></a>
                    <a href="#" class="social-link"><i class="fab fa-instagram"></i></a>
                    <a href="#" class="social-link"><i class="fab fa-weixin"></i></a>
                </div>
            </div>
            <div class="footer-column">
                <h3>快速链接</h3>
                <ul>
                    <li><a href="index.html">首页</a></li>
                    <li><a href="collections.html">数字藏品</a></li>
                    <li><a href="artists.html">艺术家</a></li>
                    <li><a href="news.html">新闻动态</a></li>
                </ul>
            </div>
            <div class="footer-column">
                <h3>支持</h3>
                <ul>
                    <li><a href="#"><i class="fas fa-question-circle"></i> 帮助中心</a></li>
                    <li><a href="#"><i class="fas fa-envelope"></i> 联系我们</a></li>
                    <li><a href="#"><i class="fas fa-users"></i> 社区指南</a></li>
                    <li><a href="#"><i class="fas fa-file-alt"></i> 服务条款</a></li>
                </ul>
            </div>
            <div class="footer-column">
                <h3>订阅更新</h3>
                <p>订阅我们的新闻通讯，获取最新藏品和活动信息。</p>
                <form>
                    <input type="email" placeholder="您的电子邮箱"
                        style="width: 100%; padding: 10px; margin: 10px 0; border-radius: 5px; border: none; background: rgba(255,255,255,0.1); color: white;">
                    <button type="submit" class="cta-button" style="width: 100%;">订阅</button>
                </form>
            </div>
        </div>
        <div class="copyright">
            <p>&copy; 2023 Surreal Gallery. 保留所有权利。</p>
        </div>
    </footer>

    <script>
        // 订单数据
        let orderData = {
            items: [],
            subtotal: 0,
            serviceFee: 0,
            networkFee: 0.0025,
            total: 0,
            paymentMethod: 'crypto',
            walletConnected: false,
            termsAgreed: false
        };

        // 初始化页面
        document.addEventListener('DOMContentLoaded', function () {
            loadOrderData();
            renderOrderItems();
            updateOrderSummary();
            setupEventListeners();
        });

        // 从本地存储加载订单数据
        function loadOrderData() {
            const cartItems = JSON.parse(localStorage.getItem('surrealCart')) || [];

            if (cartItems.length === 0) {
                // 如果购物车为空，使用示例数据
                orderData.items = [
                    {
                        id: 1,
                        title: '梦境独角兽',
                        price: 2.5,
                        icon: 'fa-horse-head',
                        artist: 'Luna Dreamer',
                        quantity: 1
                    }
                ];
            } else {
                orderData.items = cartItems;
            }

            // 计算订单金额
            calculateOrderAmounts();
        }

        // 计算订单金额
        function calculateOrderAmounts() {
            orderData.subtotal = orderData.items.reduce((sum, item) => {
                return sum + (parseFloat(item.price) * item.quantity);
            }, 0);

            orderData.serviceFee = orderData.subtotal * 0.1; // 10%服务费
            orderData.total = orderData.subtotal + orderData.serviceFee + orderData.networkFee;
        }

        // 渲染订单项目
        function renderOrderItems() {
            const orderItemsContainer = document.querySelector('.order-items');
            orderItemsContainer.innerHTML = '';

            orderData.items.forEach(item => {
                const orderItem = document.createElement('div');
                orderItem.className = 'order-item';
                orderItem.innerHTML = `
                    <div class="item-image">
                        <i class="fas ${item.icon}"></i>
                    </div>
                    <div class="item-details">
                        <div class="item-title">${item.title}</div>
                        <div class="item-artist">${item.artist}</div>
                        <div class="item-price">${item.price} ETH</div>
                    </div>
                `;
                orderItemsContainer.appendChild(orderItem);
            });
        }

        // 更新订单摘要
        function updateOrderSummary() {
            document.getElementById('sidebarSubtotal').textContent = orderData.subtotal.toFixed(4) + ' ETH';
            document.getElementById('sidebarServiceFee').textContent = orderData.serviceFee.toFixed(4) + ' ETH';
            document.getElementById('sidebarNetworkFee').textContent = orderData.networkFee.toFixed(4) + ' ETH';
            document.getElementById('sidebarTotal').textContent = orderData.total.toFixed(4) + ' ETH';

            document.getElementById('orderTotalValue').textContent = orderData.total.toFixed(4) + ' ETH';
        }

        // 设置事件监听器
        function setupEventListeners() {
            // 支付方式选择
            document.querySelectorAll('.payment-option').forEach(option => {
                option.addEventListener('click', function () {
                    document.querySelectorAll('.payment-option').forEach(opt => {
                        opt.classList.remove('selected');
                    });
                    this.classList.add('selected');

                    orderData.paymentMethod = this.getAttribute('data-method');
                    updatePaymentMethodDetails();
                });
            });

            // 连接钱包按钮
            document.getElementById('connectWalletBtn').addEventListener('click', function () {
                // 模拟钱包连接过程
                connectWallet();
            });

            // 条款同意复选框
            document.getElementById('termsAgreement').addEventListener('change', function () {
                orderData.termsAgreed = this.checked;
                updateConfirmButtonState();
            });

            // 确认支付按钮
            document.getElementById('confirmPaymentBtn').addEventListener('click', function () {
                processPayment();
            });

            // 模态框关闭按钮
            document.getElementById('modalClose').addEventListener('click', function () {
                document.getElementById('paymentModal').style.display = 'none';
            });

            // 查看藏品按钮
            document.getElementById('viewCollectionBtn').addEventListener('click', function () {
                window.location.href = 'my-collections.html';
            });

            // 继续购物按钮
            document.getElementById('continueShoppingBtn').addEventListener('click', function () {
                window.location.href = 'collections.html';
            });
        }

        // 更新支付方式详情
        function updatePaymentMethodDetails() {
            const methodValue = document.getElementById('paymentMethodValue');
            const feeValue = document.getElementById('networkFeeValue');
            const timeValue = document.getElementById('deliveryTimeValue');

            switch (orderData.paymentMethod) {
                case 'crypto':
                    methodValue.textContent = '加密货币 (ETH)';
                    feeValue.textContent = '0.0025 ETH';
                    timeValue.textContent = '即时';
                    break;
                case 'card':
                    methodValue.textContent = '信用卡/借记卡';
                    feeValue.textContent = '0.05 ETH';
                    timeValue.textContent = '2-5分钟';
                    break;
                case 'wallet':
                    methodValue.textContent = '数字钱包';
                    feeValue.textContent = '0.01 ETH';
                    timeValue.textContent = '即时';
                    break;
            }
        }

        // 连接钱包
        function connectWallet() {
            const connectBtn = document.getElementById('connectWalletBtn');
            const walletStatus = document.querySelector('.wallet-details p');
            const walletAvatar = document.querySelector('.wallet-avatar');
            const balanceAmount = document.querySelector('.balance-amount');

            // 模拟连接过程
            connectBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 连接中...';
            connectBtn.disabled = true;

            setTimeout(() => {
                // 模拟连接成功
                orderData.walletConnected = true;
                walletStatus.textContent = '已连接';
                walletStatus.style.color = 'var(--surreal-green)';
                walletAvatar.innerHTML = '<i class="fas fa-check"></i>';
                balanceAmount.textContent = '3.42 ETH';

                connectBtn.innerHTML = '<i class="fas fa-check"></i> 已连接';
                connectBtn.style.background = 'var(--surreal-green)';

                updateConfirmButtonState();
            }, 2000);
        }

        // 更新确认按钮状态
        function updateConfirmButtonState() {
            const confirmBtn = document.getElementById('confirmPaymentBtn');

            if (orderData.walletConnected && orderData.termsAgreed) {
                confirmBtn.disabled = false;
            } else {
                confirmBtn.disabled = true;
            }
        }

        // 处理支付
        function processPayment() {
            const confirmBtn = document.getElementById('confirmPaymentBtn');

            // 模拟支付处理
            confirmBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 处理中...';
            confirmBtn.disabled = true;

            setTimeout(() => {
                // 模拟支付成功
                document.getElementById('paymentModal').style.display = 'flex';

                // 清空购物车
                localStorage.removeItem('surrealCart');
            }, 3000);
        }
    </script>
</body>

</html>